import { axios } from '@/utils/request'
import storage from 'store'
// 获取消息中心列表
export function getMessageList (parameter) {
  return axios({
    url: '/sys/message/list',
    method: 'post',
    data: parameter
  })
}
// 获取消息中心列表
export function getMessageNum (parameter) {
  return axios({
    url: '/sys/message/unreadMessage',
    method: 'get',
    params: parameter
  })
}
// 获取消息中心列表
export function getMessagePage (parameter) {
  return axios({
    url: '/sys/message/page',
    method: 'post',
    data: parameter
  })
}
// 已读消息中心列表
export function readMessage (id) {
  return axios({
    url: '/sys/message/read/' + id,
    method: 'get'
  })
}
// 获取日志列表
export function getLogList (parameter) {
  return axios({
    url: '/admin/operlog/page',
    method: 'post',
    data: parameter
  })
}

// 获取日志类型
export function getLogTypeList (parameter) {
  return axios({
    url: '/admin/operlog/business/types',
    method: 'get',
    data: parameter
  })
}
export function getdictidentifiesType (parameter) {
  return axios({
    url: '/dict/data/type/identifiesType',
    method: 'get',
    data: parameter
  })
}
// date: '2023',
// dataScope: 1,
// dateType: 2
export function getmarketingprogress (parameter) {
  return axios({
    url: '/dashboard/salary/marketing/progress?date=' + parameter.date + '&dataScope=' + parameter.dataScope + '&dateType=' + parameter.dateType,
    method: 'get',
    data: parameter
  })
}
export function getdashboardindicatorbank (parameter) {
  return axios({
    url: `/dashboard/salary/important/indicator/bank?year=${parameter.year}`,
    method: 'get'
  })
}
export function getdashboardindicatorbranch (parameter) {
  return axios({
    url: `/dashboard/salary/important/indicator/branch?year=${parameter.year}`,
    method: 'get'
  })
}
export function getsalarylastmonthprofit (parameter) {
  return axios({
    url: '/admin/salary/last/month/profit',
    method: 'post',
    data: parameter
  })
}
export function getindexprofitindexCode (parameter) {
  return axios({
    url: '/index/profit/query/by/indexCode',
    method: 'post',
    data: parameter
  })
}
export function getuserList (parameter) {
  return axios({
    url: '/user/list',
    method: 'post',
    data: parameter
  })
}
// 获取下载中心列表
export function getFileList (parameter) {
  return axios({
    url: '/admin/file/list',
    method: 'post',
    data: parameter
  })
}
// 获取下载中心列表
export function getFilePage (parameter) {
  return axios({
    url: '/admin/file/page',
    method: 'post',
    data: parameter
  })
}
// getSalaryList
export function getSalaryList (parameter) {
  return axios({
    url: '/admin/salary/list',
    method: 'post',
    data: parameter
  })
}
export function salarybelongappealconfirm (parameter) {
  return axios({
    url: '/admin/salary/belong/appeal/confirm',
    method: 'post',
    data: parameter
  })
}
export function salalryhistoryexport (parameter) {
  return axios({
    url: '/admin/salary/history/export',
    method: 'post',
    data: parameter
  })
}
export function salarynetworkbelongappeal (parameter) {
  return axios({
    url: '/admin/salary/network/belong/appeal',
    method: 'post',
    data: parameter
  })
}
export function exportsalary (parameter) {
  return axios({
    url: '/admin/salary/export',
    method: 'post',
    data: parameter
  })
}
export function salarybatchconfirmdetail (parameter) {
  return axios({
    url: '/admin/salary/batch/confirm/detail',
    method: 'post',
    data: parameter
  })
}
export function salarybatchconfirm (parameter) {
  return axios({
    url: '/admin/salary/batch/confirm',
    method: 'post',
    data: parameter
  })
}
export function salarynetworkbelonginfo (parameter) {
  return axios({
    url: '/admin/salary/network/belong/appeal/info',
    method: 'post',
    data: parameter
  })
}
export function salarybatchremind (parameter) {
  return axios({
    url: '/admin/salary/batch/remind',
    method: 'post',
    data: parameter
  })
}
export function addSalary (parameter) {
  return axios({
    url: '/admin/salary/add',
    method: 'post',
    data: parameter
  })
}
export function getOrg (parameter) {
  return axios({
    url: '/org/autocomplete',
    method: 'post',
    data: parameter
  })
}
export function getSalaryTotalList (parameter) {
  return axios({
    url: '/admin/salary/branch/total/list',
    method: 'post',
    data: parameter
  })
}
export function getNetworkTotalList (parameter) {
  return axios({
    url: '/admin/salary/network/total/list',
    method: 'post',
    data: parameter
  })
}
export function distributeBath (parameter) {
  return axios({
    url: '/admin/salary/bath/distribute',
    method: 'post',
    data: parameter
  })
}
export function getSalaryHistory (parameter) {
  return axios({
    url: '/admin/salary/history/list',
    method: 'post',
    data: parameter
  })
}

export function getScheduleList (parameter) {
  return axios({
    url: '/admin/salary/distribute/schedule/list ',
    method: 'post',
    data: parameter
  })
}
export function getvaluationdetail (parameter) {
  return axios({
    url: '/admin/salary/valuation/detail',
    method: 'post',
    data: parameter
  })
}
// /admin/salary/branch/data/analysis  支行数据分析
// /admin/salary/network/data/analysis  网点数据分析
// /admin/salary/department/data/analysis  部门数据分析
// /admin/salary/personnel/data/analysis  营销人员数据分析
// /admin/salary/branch/data/analysis/export 支行导出
// /admin/salary/network/data/analysis/export  网点导出
// /admin/salary/department/data/analysis/export  部门导出
// /admin/salary/personnel/data/analysis/export  营销人员导出
export function getbranchdataanalysis (parameter) {
  return axios({
    url: '/admin/salary/branch/data/analysis',
    method: 'post',
    data: parameter
  })
}
export function getnetworkdataanalysis (parameter) {
  return axios({
    url: '/admin/salary/network/data/analysis',
    method: 'post',
    data: parameter
  })
}
export function getdepartmentdataanalysis (parameter) {
  return axios({
    url: '/admin/salary/department/data/analysis',
    method: 'post',
    data: parameter
  })
}
export function getpersonneldataanalysis (parameter) {
  return axios({
    url: '/admin/salary/personnel/data/analysis',
    method: 'post',
    data: parameter
  })
}
export function getbranchdataanalysisexport (parameter) {
  return axios({
    url: '/admin/salary/branch/data/analysis/export',
    method: 'post',
    data: parameter
  })
}
export function getnetworkdataanalysisexport (parameter) {
  return axios({
    url: '/admin/salary/network/data/analysis/export',
    method: 'post',
    data: parameter
  })
}
export function getdepartmentdataanalysisexport (parameter) {
  return axios({
    url: '/admin/salary/department/data/analysis/export',
    method: 'post',
    data: parameter
  })
}
export function getpersonneldataanalysisexport (parameter) {
  return axios({
    url: '/admin/salary/personnel/data/analysis/export',
    method: 'post',
    data: parameter
  })
}
export function salaryverify (parameter) {
  return axios({
    url: '/admin/salary/verify',
    method: 'post',
    data: parameter
  })
}
export function salaryconfirmlist (parameter) {
  return axios({
    url: '/admin/salary/belong/appeal/confirm/list',
    method: 'post',
    data: parameter
  })
}
export function getprofitconfigdetail (parameter) {
  return axios({
    url: '/admin/salary/profit/config/detail',
    method: 'post',
    data: parameter
  })
}
export function appealprofitinfo (parameter) {
  return axios({
    url: '/admin/salary/profit/appeal/info',
    method: 'post',
    data: parameter
  })
}
export function setsalarypersonnelconfig (parameter) {
  return axios({
    url: '/admin/salary/personnel/config',
    method: 'post',
    data: parameter
  })
}
export function setprofitappeal (parameter) {
  return axios({
    url: '/admin/salary/profit/appeal',
    method: 'post',
    data: parameter
  })
}
export function salarybelongappeallist (parameter) {
  return axios({
    url: '/admin/salary/belong/appeal/list',
    method: 'post',
    data: parameter
  })
}
export function getuserautocomplete (parameter) {
  return axios({
    url: '/user/autocomplete',
    method: 'post',
    data: parameter
  })
}
export function querybycode (parameter) {
  return axios({
    url: '/index/query/by/code',
    method: 'post',
    data: parameter
  })
}
export function batchsalaryverify (parameter) {
  return axios({
    url: '/admin/salary/batch/verify ',
    method: 'post',
    data: parameter
  })
}
export function handlesalaryqueryorg (parameter) {
  return axios({
    url: '/admin/salary/query/org/handle',
    method: 'post',
    data: parameter
  })
}
export function setbelongappeal (parameter) {
  return axios({
    url: '/admin/salary/belong/appeal',
    method: 'post',
    data: parameter
  })
}
export function setbatchprofitconfig (parameter) {
  return axios({
    url: '/admin/salary/batch/profit/config',
    method: 'post',
    data: parameter
  })
}
export function autocompletesalaryunit (parameter) {
  return axios({
    url: '/admin/salary/unit/autocomplete',
    method: 'post',
    data: parameter
  })
}
export function salaryprofitconfig (parameter) {
  return axios({
    url: '/admin/salary/profit/config',
    method: 'post',
    data: parameter
  })
}
export function salarytasklist (parameter) {
  return axios({
    url: '/salary/task/list',
    method: 'post',
    data: parameter
  })
}

export function gettaskstatlist (parameter) {
  return axios({
    url: '/salary/task/complete/stat/list',
    method: 'post',
    data: parameter
  })
}
export function getbanklist (parameter) {
  return axios({
    url: '/salary/bank/list',
    method: 'post',
    data: parameter
  })
}
export function getflexiblebanklist (parameter) {
  return axios({
    url: '/salary/bank/flexible/list',
    method: 'post',
    data: parameter
  })
}
export function getmerchantlist (parameter) {
  return axios({
    url: '/salary/bank/merchant/list',
    method: 'post',
    data: parameter
  })
}
export function addTargetTask (parameter) {
  return axios({
    url: '/salary/task/add/target',
    method: 'post',
    data: parameter
  })
}
export function editTargetTask (parameter) {
  return axios({
    url: '/salary/task/update/target',
    method: 'post',
    data: parameter
  })
}
export function getviewprofit (parameter) {
  return axios({
    url: '/index/view/profit',
    method: 'post',
    data: parameter
  })
}
export function getTodoList (parameter) {
  return axios({
    url: '/admin/project/manage/pending/task',
    method: 'post',
    data: parameter
  })
}
// 获取下载文件流
export function downloadFile (parameter) {
  return axios({
    url: '/admin/file/download',
    method: 'get',
    params: parameter, 
    responseType: 'blob'
  })
}
/**
 * 资方/品牌首页统计
 * @param {*} parameter 
 * @param {*} type 资方：capital；品牌：brand
 * @returns 
 */
export function otherRoleQuery(parameter){
  const userInfo = storage.get('userInfo')
  const type = userInfo.identityType === '3' ? 'brand' : 'capital'
  return axios({
    url: `/${type}/home/page/stat/data/query`,
    data: parameter,
    method: 'post'
  })
}